/*
 * PopupTransfersDialog.hpp
 *
 *  Created on: Nov 26, 2012
 *      Author: guillou
 */

#ifndef POPUPTRANSFERSDIALOG_HPP_
#define POPUPTRANSFERSDIALOG_HPP_

#include <QTimer>
#include <QDialog>
#include <PopupLibTypes.hpp>
#include "ui_transfers.h"

struct PopupProgressWidget;

struct PopupTransfersDialog : public QDialog, private Ui_TransfersDialog
{
  Q_OBJECT

public:
  PopupTransfersDialog(QWidget *p_parent = 0);
  virtual ~PopupTransfersDialog() {}

  void show();
  void hide();

protected:
  void mousePressEvent(QMouseEvent *event);
  void mouseReleaseEvent(QMouseEvent *event);
  void mouseMoveEvent(QMouseEvent *event);

public slots:
  void slot_updateFileTransferProgress(Popup::FileTransfer p_transfer);

private slots:
  void slot_fadeInOut();

private:
  typedef std::map<Popup::AttachmentID, PopupProgressWidget*> PopupProgressMap;

  PopupProgressMap m_progressWidgets;
  bool m_show;
  float m_currentOpacity;
  QTimer m_fadeTimer;
  QPoint m_offsetInWidget;
  bool m_moving;
};


#endif /* POPUPTRANSFERSDIALOG_HPP_ */
